package com.zx.notification.common.dao;

import com.zx.notification.common.model.NotificationChannelsConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface NotificationChannelsConfigMapper {
    int deleteByPrimaryKey(@Param("id") String id);

    int insert(NotificationChannelsConfig row);

    int insertSelective(NotificationChannelsConfig row);

    NotificationChannelsConfig selectByPrimaryKey(@Param("id") String id);

    int updateByPrimaryKeySelective(NotificationChannelsConfig row);

    int updateByPrimaryKey(NotificationChannelsConfig row);

    NotificationChannelsConfig selectByChannelType(@Param("channelType") String channelType);

    Long getNotificationChannelsConfigListCount(@Param("channelType") String channelType,
                                                @Param("channelName") String channelName,
                                                @Param("mqType") String mqType,
                                                @Param("status") Integer status,
                                                @Param("createTimeStart") LocalDateTime createTimeStart,
                                                @Param("createTimeEnd") LocalDateTime createTimeEnd);

    List<NotificationChannelsConfig> getNotificationChannelsConfigListByPage(@Param("channelType") String channelType,
                                                                             @Param("channelName") String channelName,
                                                                             @Param("mqType") String mqType,
                                                                             @Param("status") Integer status,
                                                                             @Param("createTimeStart") LocalDateTime createTimeStart,
                                                                             @Param("createTimeEnd") LocalDateTime createTimeEnd,
                                                                             @Param("pageNum") Long pageNum,
                                                                             @Param("pageSize") Long pageSize);

    NotificationChannelsConfig selectByChannelTypeAndStatus(@Param("channelType") String channelType,
                                                            @Param("status") Integer status);

    List<NotificationChannelsConfig> selectByMqTypeAndStatus(@Param("mqType") String mqType,
                                                             @Param("status") Integer status);
}